package models

import (
	"gorm.io/gorm"
)

type Dish struct {
	gorm.Model
	Id          int           `gorm:"column:id;type:int(11);" json:"id"`
	Name        string        `gorm:"column:name;type:varchar(32);" json:"name"`
	Price       float64       `gorm:"column:price;type:decimal(10,2);" json:"price"`
	CategoryId  int           `gorm:"column:category_id;type:int(11);" json:"categoryId"`
	Status      *int          `gorm:"column:status;type:int(2);" json:"status"`
	Description string        `gorm:"column:description;type:varchar(255);" json:"description"`
	Image       string        `gorm:"column:image;type:varchar(255);" json:"image"`
	Flavors     []*DishFlavor `gorm:"foreignKey:dish_id;references:id"  json:"flavors"`
}

func (Dish) TableName() string {
	return "dish"
}
